<div id="mdlOrder" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Orden Columnas" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Ordenar Columnas</h3>
    </div>
    <form action="<?php echo url_for('notes/createOrder'); ?>" method="POST">
        <input type="hidden" name="tableColumn" value="Notas" />
        <div class="modal-body">
            <div class="row-fluid">
                <div class="span12">
                    <div class="box box-bordered box-color lightgrey">
                        <div class="box-title">
                            <h3><i class="icon-reorder"></i>Ordernar Columnas</h3>
                            <div class="actions">
                                <a href="<?php echo url_for('notes/clearOrder'); ?>" role="button" class="btn"><i class="icon-remove">Borrar</i></a>
                            </div>
                        </div>

                        <div class="box-content nopadding">
                            <ol>
                                <?php 
                                
                                if($userOrderCount){
                                
                                foreach ($userTableOrder as $value) { ?>
                                    <li>
                                        <input type="hidden" name="order[]" value="<?php echo $value['id_tablecolumn']; ?>" />
                                            <?php echo $value['table_column']; ?> [<a class="move-up"><i class="icon-angle-up"></i></a>/<a class="move-down"><i class="icon-angle-down"></i></a>]
                                            <input type="checkbox" name="visible[<?php echo $value['id_tablecolumn']; ?>]" value="1" <?php echo (($value['UserTableOrder'][0]['visible']==1?'checked':''));?> />    
                                    </li>

                                <?php }
                                }else{
                                    
                                    foreach ($userTableOrder as $value) { ?>
                                    <li>
                                        <input type="hidden" name="order[]" value="<?php echo $value['id_tablecolumn']; ?>" />
                                            <?php echo $value['table_column']; ?> [<a class="move-up"><i class="icon-angle-up"></i></a>/<a class="move-down"><i class="icon-angle-down"></i></a>]
                                            <input type="checkbox" name="visible[<?php echo $value['id_tablecolumn']; ?>]" value="1" />    
                                    </li>
                                    
                                    <?php }
                                }?>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Cerrar</button>
            <button class="btn btn-primary">Guardar</button>
        </div>
    </form>
</div>